package com.xt.core.data;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.MappedSuperclass;
import javax.persistence.Table;

import javax.validation.constraints.Size;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Email;


@MappedSuperclass
public abstract class BasicUser extends BasicDBObject{

	private static final long serialVersionUID = 3725747145529885289L;
	
	@NotEmpty(message="{user.validator.username.required}")
	@Size(min = 3, max = 40, message="{user.validator.username.required}")
	@Column(name = "username")
	private String username;
	
	@NotEmpty(message="{user.validator.password.required}")
	@Size(min = 3, max = 40, message="{user.validator.password.required}")
	@Column(name = "password")
	private String password;

	@NotEmpty(message="{user.validator.firstname.required}")
	@Size(min = 2, max = 40, message="{user.validator.firstname.required}")
	@Column(name = "firstname")
	private String firstName;
	
	@NotEmpty(message="{user.validator.surname.required}")
	@Size(min = 2, max = 40, message="{user.validator.surname.required}")
	@Column(name = "surname")
	private String surname;
	
	@NotEmpty(message="{user.validator.email.required}")
	@Email(message="{user.validator.email.required}")
	@Column(name = "email")
	private String email;

	@Column(name = "createdOn")
	private Date createdOn = new Date();
	
	public BasicUser() {}

	public String getUsername() {
		return username;
	}

	public void setUsername ( String username ) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword ( String password ) {
		this.password = password;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Date getCreatedOn() {
		return createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}
	
	

}

